package com.neuedu.carsystem.dao.impl;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.neuedu.carsystem.dao.AdminDao;
import com.neuedu.carsystem.model.Admin;
//把dao接口实现类，交给spring进行管理
@Repository
public class AdminDaoImpl implements AdminDao {
	// 代码层级的整合spring+mybatis
		@Autowired
		private SqlSessionTemplate sqlSessionTemplate;
		public void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate) {
			this.sqlSessionTemplate = sqlSessionTemplate;
		}
	@Override
	public String findName(String id) {
		return sqlSessionTemplate.getMapper(AdminDao.class).findName(id);
	}
	@Override
	public Admin findAdminByName(Admin u) {
		// TODO Auto-generated method stub
		return sqlSessionTemplate.getMapper(AdminDao.class).findAdminByName(u);
	}

}
